package com.roncoo.eshop.inventory.dao.impl;

import javax.annotation.Resource;

import com.roncoo.eshop.inventory.utils.JedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import redis.clients.jedis.JedisCluster;

import com.roncoo.eshop.inventory.dao.RedisDAO;

@Repository("redisDAO")
public class RedisDAOImpl implements RedisDAO {

/*	@Resource
	private JedisCluster jedisCluster;*/

	@Autowired
	private JedisUtils jedisUtils;

	@Override
	public void set(String key, String value) {
		///jedisCluster.set(key, value);
		jedisUtils.set(key, value);
	}

	@Override
	public String get(String key) {
		///return jedisCluster.get(key);
		return jedisUtils.get(key, null);
	}

	@Override
	public void delete(String key) {
		///jedisCluster.del(key);
		jedisUtils.del(key);
	}

}
